<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html><head>
        <link rel="stylesheet" type="text/css" href="apidocs.css"/>
        <title>API docs for &ldquo;sympy.ntheory.generate&rdquo;</title>
        </head>
        <body><h1 class="module">Module s.n.generate</h1><span id="part">Part of <a href="sympy.ntheory.html">sympy.ntheory</a></span><div class="toplevel"><div><p>Generating and counting primes.</p>
</div></div><table class="children"><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate._arange">_arange</a></td><td><span class="undocumented">Undocumented</span></td></tr><tr class="class"><td>Class</td><td><a href="sympy.ntheory.generate.Sieve.html">Sieve</a></td><td><div><p>An infinite list of prime numbers, implemented as a dynamically</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate.prime">prime</a></td><td><div><p>Return the nth prime, with the primes indexed as prime(1) = 2,</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate.primepi">primepi</a></td><td><div><p>Return the value of the prime counting function pi(n) = the number</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate.nextprime">nextprime</a></td><td><div><p>Return the smallest prime greater than n.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate.prevprime">prevprime</a></td><td><div><p>Return the largest prime smaller than n.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate.primerange">primerange</a></td><td><div><p>Generate a list of all prime numbers in the range [a, b).</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.ntheory.generate.randprime">randprime</a></td><td><div><p>Return a random prime number in the range [a, b)</p>
</div></td></tr></table>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate._arange">_arange(a, b):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate.prime">prime(n):</a></div>
            <div class="functionBody"><div><p>Return the nth prime, with the primes indexed as prime(1) = 2, prime(2) 
= 3, etc.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate.primepi">primepi(n):</a></div>
            <div class="functionBody"><div><p>Return the value of the prime counting function pi(n) = the number of 
prime numbers less than or equal to n. The number n need not necessarily be
an integer.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate.nextprime">nextprime(n):</a></div>
            <div class="functionBody"><div><p>Return the smallest prime greater than n.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate.prevprime">prevprime(n):</a></div>
            <div class="functionBody"><div><p>Return the largest prime smaller than n.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate.primerange">primerange(a, b):</a></div>
            <div class="functionBody"><div><p>Generate a list of all prime numbers in the range [a, b).</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.ntheory.generate.randprime">randprime(a, b):</a></div>
            <div class="functionBody"><div><p>Return a random prime number in the range [a, b)</p>
</div></div>
            </div></body>
        